@import (reference) '../../styles/variables.less';

.@{prefix}-toc {
  list-style: none;
  margin: 12px 0 0;
  padding:  0;
  border-inline-start: 1px solid @c-border;

  @{dark-selector} & {
    border-inline-start-color: @c-border-dark;
  }

  &:empty {
    display: none;
  }

  > li {
    margin-bottom: 12px;
    > a {
      display: block;
      margin: 6px 0;
      padding: 5px 12px;
      color: @c-text;
      font-size: 15px;
      line-height: 1;
      text-decoration: none;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;

      @{dark-selector} & {
        color: @c-text-dark;
      }

      &:hover {
        color: @c-primary;
        border-inline-start: 1px solid @c-primary;
        
        @{dark-selector} & {
          color: @c-text-dark-all-white;
        }
      }

      &.active {
        margin-inline-start: -1px;
        color: @c-primary;
        border-inline-start: 1px solid @c-primary;

        @{dark-selector} & {
          color: @c-primary-dark;
          border-inline-start-color: @c-primary-dark;
        }
      }
    }

    &[data-depth='3'] > a {
      padding-inline-start: 20px;
    }
  }
}